import request from '@/utils/request'
import type { ApiResult, BaseIds, PageSchema } from '@/api/api'
import type { Log, LogAddDTO, LogModDTO, LogQueryDTO } from '@/api/system/log/type'
const BASE_URL = '/admin/api/v1/system/log'
const API = {
  BASE_URL,
  PAGE_URL: BASE_URL + '/page',
  LIST_URL: BASE_URL + '/list',
  REMOVE_URL: BASE_URL + '/rm',
}
// 添加日志信息
export const logAdd = (data: LogAddDTO) => {
  return request.post<any, ApiResult<unknown>>(API.BASE_URL, data)
}
// 修改日志信息
export const logMod = (data: LogModDTO) => {
  return request.put<any, ApiResult<unknown>>(API.BASE_URL, data)
}
// 删除日志信息
export const logDel = (data: BaseIds) => {
  return request.post<any, ApiResult<unknown>>(API.REMOVE_URL, data)
}
// 查询日志信息
export const logList = (data: LogQueryDTO) => {
  return request.post<any, ApiResult<Log[]>>(API.LIST_URL, data)
}
// 查询分页数据
export const logQuery = (data: LogQueryDTO) => {
  return request.post<any, ApiResult<PageSchema<Log>>>(API.PAGE_URL, data)
}
